//
//  NetIsReachabitity.m
//  One
//
//  Created by mac on 16-5-20.
//  Copyright (c) 2016年 mac. All rights reserved.
//

#import "NetIsReachabitity.h"

@implementation NetIsReachabitity

+ (void)networkIsReachability
{
    AFNetworkReachabilityManager *manager = [AFNetworkReachabilityManager sharedManager];
    [manager startMonitoring];
    __block UIAlertController *alert = nil;
    [manager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
        if(status == 0)
        {
            alert = [UIAlertController alertControllerWithTitle:@"没有网络连接" message:nil preferredStyle:UIAlertControllerStyleAlert];
            [NOTI_CENTER postNotificationName:@"reach" object:alert];
        }
        else
        {
            [NOTI_CENTER postNotificationName:@"reach" object:nil];
            
        }
    }];
}
@end
